$(function () {	
	
	var condition_genres = $('#condition_genres').val();	
	if( condition_genres != ''){
		var condition_genres_id = '#genres_'+condition_genres;
		$(condition_genres_id).css({color:"red"}) 
	} else {
		$('#genres_All').css({color:"red"}) 
	}
	
	var condition_years = $('#condition_years').val();	
	if($('#condition_years').val() != ''){
		var condition_years_id = '#years_'+condition_years;
		$(condition_years_id).css({color:"red"}) ;
	} else {
		$('#years_All').css({color:"red"}) 
	}
	
	$(".condition_genres").click(function(){
		var condition_years = $('#condition_years').val();
		var condition_genres = $(this).html();
		location.href="/search?genres="+condition_genres+"&years="+condition_years;
	});
	
	$(".condition_years").click(function(){
		var condition_genres = $('#condition_genres').val();
		var condition_years = $(this).html();
		location.href="/search?genres="+condition_genres+"&years="+condition_years;
	});
});